import React from 'react'
import FileViewer from 'react-file-viewer'
import excel from './sample.xlsx'
import {message} from 'antd'
import XLSX from 'xlsx'

const Viewer = () => {
    const filePath = excel
    const type = filePath.split('.')[filePath.split('.').length - 1]
    console.log(excel)
    return (
        <div className='view'>
            {/* {type ? (
                <FileViewer
                    fileType='xlsx'
                    filePath={excel}
                    errorComponent={''}
                    onError={err => console.log(err)}
                    unsupportedComponent={message.error('不支持该类型文件')}
                />
            ) : (
                <div style={{ textAlign: 'center' }}>暂无文件预览</div>
            )} */}
            <a src='./第6章课件.pdf' href='./第6章课件.pdf' target="_Blank">123</a>
        </div>
    )
}

export default Viewer